package com.fingard.dsp.bank.directbank.icbc02;

import java.util.Date;

import com.fingard.dsp.bank.directConfig.ReceiptProConfig;
import com.fingard.dsp.bank.directbank.bankInterface.IReceiptPro;
import com.fingard.dsp.bank.directbank.icbc02.receiptpro.ICBC02ReceiptProFtp;
import com.fingard.dsp.bank.directbank.icbc02.receiptpro.ICBC02ReceiptProFtpHeadVersion;
import com.fingard.dsp.bank.reqrespobj.downloadreceipt.ReqQryReceipt;
import com.fingard.dsp.bank.reqrespobj.downloadreceipt.RetAtsReceipt;

public class ICBC02ReceiptPro extends ICBC02Base implements IReceiptPro{
	
	/**实现IReceiptPro接口方法*/
	public RetAtsReceipt qryReceiptOneDay(ReceiptProConfig pConfig, ReqQryReceipt pReqReceipt, Date pOneDay) throws Exception {
		if (getBankConfig().getValueAsBool("isHeadVersion")) {
			//文件为T-1日的明细，如果明细过多，会分包发送，通过ZIP文件名中的序号来区分。
			//无html，文件名为: 账号+’_’+交易日期+‘_’+11位银行流水号.pdf
			ICBC02ReceiptProFtpHeadVersion receiptProFtpHeadVer = new ICBC02ReceiptProFtpHeadVersion();
			receiptProFtpHeadVer.reqHeader = this.reqHeader;
			receiptProFtpHeadVer.bankFront = this.bankFront;
			receiptProFtpHeadVer.setSbLog(this.sbLog);
			receiptProFtpHeadVer.setLogFlushTime(this.logFlushTime);
			return receiptProFtpHeadVer.qryReceiptOneDay(pConfig, pReqReceipt, pOneDay);
		}else{
			//ftp方式，一天一个.zip文件，有html索引文件
			//代码目录/icbc02/receiptpro/ICBC02ReceiptProFtp
			ICBC02ReceiptProFtp receiptProFtp = new ICBC02ReceiptProFtp();
			receiptProFtp.reqHeader = this.reqHeader;
			receiptProFtp.bankFront = this.bankFront;
			receiptProFtp.setSbLog(this.sbLog);
			receiptProFtp.setLogFlushTime(this.logFlushTime);
			return receiptProFtp.qryReceiptOneDay(pConfig, pReqReceipt, pOneDay);
		}
	}
	

}
